home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 3 #11
/
Commodore_Disk_User_Vol.3_11_1990_-.d64
/
techno info
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
3KB
|
71 lines
10 rem ********************************
20 rem * techno info program *
30 rem * written for september 1990 *
40 rem * issue of cdu by j.r.finch. *
50 rem ********************************
60 :
70 :
80 sa=832: rem ** start address for data
100 print"[147]":input"how many data items to created (1-100) ";n
110 if n<1 or n>100 then 100
120 print"please wait: storing values as if it were sprite data info..."
125 print"program will write lines containing 8"
127 print"bytes and therefore may write more than you intend."
130 forx=1ton:poke831+x,int(rnd(1)*256):next: rem ** create random data
140 :
150 input"enter start line number (1000-60000) ";sl
160 if sl<1000 or sl>60000 then print"[145][145][145]":goto150
170 input"enter line increment (1-100) ";li
180 if li<1 or li>100 then print"[145][145][145][145]":goto170
190 :
200 rem *******************************
210 rem * we shall start printing the *
220 rem * data, exiting and then *
230 rem * re-entering the program *
240 rem * shortly: save any variables *
250 rem * now to some locations in *
260 rem * memory as shown by the *
270 rem * example line 300 *
280 rem *******************************
290 :
300 poke 679,x1:poke 680,y1:poke 681,c1
310 :
320 rem *******************************
330 rem * store start line/ address / *
340 rem * increment/ no.of data items *
350 rem *******************************
360 :
365 poke 682,((sl/256)-int(sl/256))*256:poke 683,sl/256
370 poke 685,((sa/256)-int(sa/256))*256:poke 686,sa/256
375 poke 687,li
380 poke 688,((n/256)-int(n/256))*256:poke 689,n/256
385 :
390 rem *******************************
400 rem * program will return to line *
410 rem * 500 so start retrieving *
420 rem * variables and calculating *
430 rem * next line number and address*
440 rem * at that line and let loc'n *
450 rem * two hold the value for the *
460 rem * number of lines done so far *
470 rem *******************************
480 :
490 poke2,0
500 nl=(peek(682)+peek(683)*256)+peek(687)*peek(2): rem ** calc. next line nmbr
510 ad=peek(685)+peek(686)*256+peek(2)*8: rem ** start addr. for 1st of next 8
520 :
525 if ad>=((peek(688)+peek(689)*256)+(peek(685)+peek(686)*256)) then 620
530 print"[147]"nl"data";
540 for x=0 to 7: print peek(ad+x)"[157],";: next: rem ** print out values of next 8
550 print"[157] ":print"goto500";:rem ** end of last line - get ready to exit
560 :
565 poke2,peek(2)+1: rem ** increase no. of lines done (max=255)
570 poke631,13:poke632,13:poke198,2:end
580 rem ^^ fill buffer with chr$(13) and exit program
590 rem ** line will be entered, and computer will execute 'goto' statement
600 rem ** thus returning to line 500 for more if any is left
610 :
620 rem ** all done so exit program (return from a subroutine if necessary)
630 :
640 end